import { LoginAction } from '@/types/store'

// 登录的reducer
function login (state = {}, action: LoginAction) {
  switch (action.type) {
    // 存储 token
    case 'login/login':
      return action.payload
    case 'user/logout':
      return {}
    default:
      return state
  }
}

export default login
